home *** CD-ROM | disk | FTP | other *** search
/ Aminet 48 / Aminet 48 (2002)(GTI - Schatztruhe)[!][Apr 2002].iso / Aminet / util / cli / dprun.lha / dprun.e next >
Encoding:
Text File  |  2002-02-09  |  771 b   |  41 lines

  1. /*
  2. ** DPRun 1.0
  3. **
  4. ** ©2002 Peter Gordon
  5. **
  6. ** Please credit me if you use this source.
  7. **
  8. */
  9.  
  10. MODULE 'intuition/intuition',
  11.        'intuition/screens'
  12.  
  13. PROC main()
  14.   DEF rstr[MAXPUBSCREENNAME]:STRING,rdargs,myargs:PTR TO LONG,od[MAXPUBSCREENNAME]:ARRAY OF CHAR
  15.   myargs:=[0,0]
  16.  
  17.   /* Get args */
  18.  
  19.   IF(rdargs:=ReadArgs('PUBSCREEN/A,PROG/A/F',myargs,0))
  20.  
  21.     StringF(rstr,'Run <>NIL: "\s"',myargs[1])
  22.  
  23.     /* Get current default pubscreen */
  24.     GetDefaultPubScreen(od)
  25.  
  26.     /* Set it to the user specified screen */
  27.     SetDefaultPubScreen(myargs[0])
  28.  
  29.     /* Run the program */
  30.     Execute(rstr,0,0)
  31.     
  32.     /* Give the program a chance to run */
  33.     Delay(50)
  34.     
  35.     /* Reset the default pubscreen */
  36.     SetDefaultPubScreen(od)
  37.  
  38.     FreeArgs(rdargs)
  39.   ENDIF
  40. ENDPROC
  41.